/* eslint-disable */
import React from "react";
import Chart from "echarts-for-react";
import style from "./Echarts_tu.less";
import request from '../../../utils/request';

class Echarts_left1 extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            xianzhi:0,
            data:0
        }



    }

    componentDidMount() {

        request({
            url: `/sx-client/sx/indicator/theTotalLoadRate`,
            method: 'GET',
        }).then(data => {
            if(data.rc === 0) {
                this.setState({
                    data:data.ret.data
                })
            }
        })
    }




    setOption = () => {

        return {
            tooltip: {
                formatter: '{a} <br/>{b} : {c}%'
            },

            series: [
                {
                    name: '负荷',
                    type: 'gauge',
                    detail: {formatter: '{value}'},
                    data: [{value: this.state.data, name: '负荷'}]
                }
            ]
        };



    }

    render() {
        console.log(this.props)
        return (

            <Chart option={this.setOption()} notMerge lazyUpdate 
                style={{ height: '100%' }}
            />




        );
    }

}

export default Echarts_left1;
